function searchUrbanDict() {
    return function(info, tab) {
        if (info.mediaType == "image") {
           console.log(info.mediaType);
            var url = info.srcUrl;
            chrome.tabs.query({
                active: true,
                currentWindow: true
            },
            function(tabs) {
                chrome.tabs.sendMessage(tabs[0].id, {
                    url: url
                },
                function(response) {
                    if (response.result != "nil") {
                        chrome.downloads.download({
                            url: response.result
                        },
                        function() {})
                    }
                })
            })
        }else if(info.mediaType=="video"){

            alert("Aone");
        }
    }
};
chrome.contextMenus.create({
    title: "  picker! picker!",
    type: "normal",
    contexts: ["image","video"],
    onclick: searchUrbanDict()
},
);
